#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def fn(self,name='world'):# 先定义一个函数
    print('Hello,%s.' % name)

Hello = type('Hello',(object,),dict(hello=fn)) # 创建Hello class

h = Hello()
print(type(h)) # <class '__main__.Hello'>
print(type(Hello)) # <class 'type'>
h.hello('马利克') # Hello,马利克.
